package service

import (
	"gitee.com/huangxinbo/xcas/internal/app/base"
	"gitee.com/huangxinbo/xcas/internal/dao"
)

type Service struct {
	// Add Service layer instances
	UserService         *UserService
	CasService          *CasService
	VerificationService *VerificationService
	FileService         *FileService
	OAuthService        *OAuthService
	DAO                 *dao.DAO
}

func NewService(base *base.Base, dao *dao.DAO) *Service {
	// 先创建 Service 实例
	service := &Service{}

	// 创建各个 service 实例，并注入 service 容器
	service.UserService = NewUserService(base, dao, service)
	service.CasService = NewCasService(base, dao, service)
	service.VerificationService = NewVerificationService(base, dao, service)
	service.FileService = NewFileService(base, dao, service)
	service.OAuthService = NewOAuthService(base, dao, service)

	return service
}
